CC := g++
PKG_CONFIG?=pkg-config
LIBS=$(shell $(PKG_CONFIG) fuse --libs)
FUSEFLAGS=$(shell $(PKG_CONFIG) fuse --cflags)
CFLAGS := -D_FILE_OFFSET_BITS=64 -g -O0 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -std=c++11
OBJS := $(patsubst %.cpp, %.o, $(wildcard *.cpp))

LIBS := -lfuse -lpthread -L . -ljansson -I .

TARGET := vmfuse

.PHONY: all clean

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) $(FUSEFLAGS) -o $@ $^ $(LIBS)

.cpp.o:
	$(CC) $(CFLAGS) $(FUSEFLAGS) -c $< $(LIBS)

clean:
	rm -f $(TARGET) $(OBJS)

